import Cookies from 'js-cookie'
const app = {
    state: {
        sidebar: {
            opened: !+Cookies.get('sidebarStatus')
        }
    },
    mutations: {
        TOGGLE_SIDEBAR: state => {
            Cookies.set('sidebarStatus', state.sidebar.opened ? 1 : 0)
            state.sidebar.opened = !state.sidebar.opened
        }
    },
    actions: {
        toggleSideBar({ commit }) {
            commit('TOGGLE_SIDEBAR')
        }
    }
}
export default app